#include "GraphPointerGuard.h"

#include <stddef.h>

namespace native_orbitor
{

GraphPointerGuard::GraphPointerGuard( GRAPH_SUPPORT_NS::Graph * abstractGraphPtr, void ( * deleteGraphFunc ) ( GRAPH_SUPPORT_NS::Graph * ) )
	: abstractGraphPtr( abstractGraphPtr )
	, deleteGraphFunc( deleteGraphFunc )
{
}

GRAPH_SUPPORT_NS::Graph * GraphPointerGuard::getAbstractGraphPtr()
{
	return abstractGraphPtr;
}

GraphPointerGuard::~GraphPointerGuard()
{
	deleteGraphFunc( abstractGraphPtr );
	abstractGraphPtr = NULL;
}


}
